package it.patterns.behavioral.observer;

public class ConcreteObserverB implements Observer {

	@Override
	public void update(Subject subject) {
		int value = 0;
		if (subject instanceof ConcreteSubject) {
			ConcreteSubject sub = (ConcreteSubject) subject;
			value = sub.getState();
		} else
			return;

		System.out.println("I'm " + this.getClass().getSimpleName()
				+ ". Something has changed on "
				+ subject.getClass().getSimpleName() + " : " + value);
	}
}
